﻿using CarAppDomain.Base;
using SqlSugar;

namespace CarAppDomain.Rule.Entities
{
    /// <summary>
    /// 规则主表
    /// </summary>
    [SugarTable("rule_mapping", TableDescription = "规则映射表")]
    [SugarIndex("IX_RuleId_RegStr", "RuleId", OrderByType.Asc, "RegStr", OrderByType.Asc)] // 定义索引  
    public class RuleMappingEntity : BaseEntity
    {
        /// <summary>
        /// 规则主键ID
        /// </summary>
        [SugarColumn(ColumnDataType = "varchar", Length = 36, IsNullable = false, ColumnDescription = "规则主键ID")]
        public string? RuleId { get; set; }

       
        /// <summary>
        /// 键
        /// </summary>
        [SugarColumn(ColumnDataType = "varchar", Length = 254, IsNullable = true, ColumnDescription = "键")]
        public string? Key { get; set; }

        /// <summary>
        /// 值，若是值类型已，拼接，引用类型存id
        /// </summary>
        [SugarColumn(ColumnDataType = "varchar", Length = 36, IsNullable = true, ColumnDescription = "值")]
        public string? Val { get; set; }

        /// <summary>
        /// 值详情
        /// </summary>
        [SugarColumn(ColumnDataType = "text",  IsNullable = false, ColumnDescription = "值详情")]
        public string? ValueDetails { get; set; }

        /// <summary>
        /// 正则匹配字符串
        /// </summary>
        [SugarColumn(ColumnDataType = "varchar", Length = 200, IsNullable = true, ColumnDescription = "正则匹配字符串")]
        public string? RegStr { get; set; }


        /// <summary>
        /// 描述
        /// </summary>
        [SugarColumn(ColumnDataType = "varchar", Length = 500, IsNullable = true, ColumnDescription = "描述")]
        public string? Descption { get; set; }
    }
}
